﻿using AutoMapper;
using B.S.BasicData.Api.Write.Applications.Command;
using B.S.BasicData.Domains;

namespace B.S.BasicData.Api.Write
{
    /// <summary>
    /// 映射轮廓
    /// </summary>
    public class MapperProFiles:Profile
    {
        /// <summary>
        /// 方法
        /// </summary>
        public MapperProFiles()
        {
            CreateMap<AddPermissonCommand,Permissons>().ReverseMap();
            CreateMap<DelPermissonCommand,Permissons>().ReverseMap();
            CreateMap<AddRoleCommand, Role>().ReverseMap();
            CreateMap<AddRoleCommand, RolePermissons>().ReverseMap();
            CreateMap<UpdateRoleCommand, RolePermissons>().ReverseMap();
            CreateMap<UpdateRoleCommand, Role>().ReverseMap();
            CreateMap<AddRoleUserCommand, UserInfos>().ReverseMap();
            CreateMap<AddRoleUserCommand, RoleUser>().ReverseMap();
            CreateMap<UpdateUserRoleCommand, UserInfos>().ReverseMap();
            CreateMap<UpdateUserRoleCommand, RoleUser>().ReverseMap();
            CreateMap<AddUserCommand, UserInfos>().ReverseMap();
            CreateMap<AddUserCommand, RoleUser>().ReverseMap();
            CreateMap<AddUserCommand, RolePermissons>().ReverseMap();
        }
    }
}
